//
//  ComplainFrame.m
//  智慧小区
//
//  Created by lab603 on 15/7/6.
//  Copyright (c) 2015年 Dreamsoul. All rights reserved.
//

#import "ComplainFrame.h"
#import "Complain.h"
#define Top_Padding 10
#define Left_Padding 20
#define statusIconWH 25
#define typeIconWH 60
@implementation ComplainFrame
- (void)setComplain:(Complain *)complain{
    _complain = complain;
    //类别图标Frame
    CGFloat typeIconX = Left_Padding;
    CGFloat typeIconY = Top_Padding;
    CGSize typeIconSize = (CGSize){typeIconWH,typeIconWH};
    _typeIconF = (CGRect){{typeIconX,typeIconY},typeIconSize};
    //时间LabelFrame
    CGFloat timeLabelX = CGRectGetMaxX(_typeIconF)+Top_Padding;
    CGFloat timeLabelY = typeIconY;
    CGSize timeLabelSize = [complain.lastEditTime sizeWithFont:[UIFont systemFontOfSize:14.0]];
    _timeLabelF = (CGRect){{timeLabelX,timeLabelY},timeLabelSize};
    //投诉状态图Frame
    CGFloat statusIconX = timeLabelX;
    CGFloat statusIconY = CGRectGetMaxY(_timeLabelF)+Top_Padding;
    CGSize statusIconSize = (CGSize){statusIconWH,statusIconWH};
    _statusIconF = (CGRect){{statusIconX,statusIconY},statusIconSize};
    //业主对物业满意程度Frame
    CGFloat ownerIconX = CGRectGetMaxX(_statusIconF)+Top_Padding;
    CGFloat ownerIconY = statusIconY;
    CGSize ownerIconSize = (CGSize){statusIconWH,statusIconWH};
    _ownerIconF = (CGRect){{ownerIconX,ownerIconY},ownerIconSize};
    //物业对投诉的认可度Frame
    CGFloat propertyIconX = CGRectGetMaxX(_ownerIconF)+Top_Padding;
    CGFloat propertyIconY = ownerIconY;
    CGSize propertyIconSize = (CGSize){statusIconWH,statusIconWH};
    _propertyIconF = (CGRect){{propertyIconX,propertyIconY},propertyIconSize};
    //投诉建议文字Frame
    CGFloat complainDetailX = statusIconX;
    CGFloat complainDetailY = CGRectGetMaxY(_statusIconF)+Top_Padding;
    CGSize complainDetailSize = (CGSize){ScreenWidth-complainDetailX-Left_Padding,15};
    _complainDetailF = (CGRect){{complainDetailX,complainDetailY},complainDetailSize};
    //评价按钮Frame
    CGFloat remindBtnX = CGRectGetMaxX(_statusIconF)+Left_Padding;
    CGFloat remindBtnY = statusIconY;
    CGSize remindBtnSize = (CGSize){65,25};
    _remindBtnF = (CGRect){{remindBtnX,remindBtnY},remindBtnSize};
    //cell的高度
    _cellHeight = CGRectGetMaxY(_complainDetailF)+Top_Padding*2;
}
@end
